<%@include file="template/configuration.jsp" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>${website} || Manage files</title>
        ${stylesheet}
        ${jquery}
        ${jsdropdown}
    </head>
    <body>
        <div class="container">
            <%@include file="template/header.jsp" %>
            <div class="content">
                <h1>Manage files for ${lesson.name}</h1>

                <c:choose>
                    <c:when test="${edit}">
                        <h3>Edit file</h3>
                        <form action="../ManageFileController" method="POST" enctype="multipart/form-data">
                            <input type="hidden" value="${filex.id}" name="fileid"/>
                            <input type="hidden" value="edit" name="edit"/>
                        </c:when>
                        <c:otherwise>
                            <h3>Add file</h3>
                            <form action="../ManageFileController" method="POST" enctype="multipart/form-data">
                            </c:otherwise>
                        </c:choose>
                        <input type="hidden" value="${lesson.id}" name="lessonid"/>
                        <label for="file">File name</label> <input type="text" name="filename" value="${filex.name}"/>
                        </br>
                           <label for="file"></label> <input type="checkbox" name="isassignment" value="isassignment" 
                                                             <c:if test="${edit}"><c:if test="${filex.type eq 'assignment'}">checked</c:if></c:if>>
                           File is an assignment
                        </br></br>
                        <c:if test="${edit}">  <label for=""></label> 
                            <input type="checkbox" name="overwrite" value="overwriteurl"> Overwrite existing file.</br>
                        </c:if>
                            <label for="file">Choose file</label> <input type="file" name="upfile" value="hello" title="Select a file."/> <c:if test="${errormessage}">Not acceptable file extension.</c:if>
                         
                            </br>



                        </br>
                        <input type="submit" value="Save files"/>
                    </form>
            </div>
            <%@include file="template/footer.jsp" %>
        </div>
    </body>
</html>
